package com.bwjf.dzfp.common.base.entity;

import java.util.ArrayList;
import java.util.List;

/**
 * @author : ZhouBin
 * @date : 2013-5-22
 * @describe : 分页相关参数
 * @version ：1.0
 */
public class PageInfo {
	/**
	 * 当前页
	 */
	private int page = 1;
	/**
	 * 每页显示多少条记录
	 */
	private int rows = 20;
	/**
	 * 总记录
	 */
	private long totalCount = 0;
	/**
	 * 总页数
	 */
	private int totalPage = 0;
	/**
	 * 结果集
	 */
	private List list = new ArrayList();
	/**
	 * 排序字段名
	 */
	private String sort;
	/**
	 * 排序顺序
	 */
	private String order;
	/**
	 * 开始索引
	 */
	private int startIndex;
	/**
	 * 结束索引
	 */
	private int endIndex;

	public int getStartIndex() {
		return (page - 1) * rows;
	}

	public void setStartIndex(int startIndex) {
		this.startIndex = startIndex;
	}

	public int getEndIndex() {
		return page * rows;
	}

	public void setEndIndex(int endIndex) {
		this.endIndex = endIndex;
	}

	public long getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(long totalCount) {
		this.totalCount = totalCount;
	}

	public int getTotalPage() {
		return (int) (totalCount + 1) / rows + 1;
	}

	public List getList() {
		return list;
	}

	public void setList(List list) {
		this.list = list;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getRows() {
		return rows;
	}

	public void setRows(int rows) {
		this.rows = rows;
	}

	public String getSort() {
		return sort;
	}

	public void setSort(String sort) {
		this.sort = sort;
	}

	public String getOrder() {
		return order;
	}

	public void setOrder(String order) {
		this.order = order;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}
}
